#include <cstdio>
constexpr int MaxN = 1e5 + 5;
int x, y;
int dp[MaxN];
int main()
{
    freopen("op.in", "r", stdin);
    freopen("op.out", "w", stdout);
    scanf("%d%d", &x, &y);
    dp[x] = 1;
    for (int i = x; i <= y; i++)
    {
        dp[i * 2] += dp[i];
        dp[i + 1] += dp[i];
    }
    printf("%d\n", dp[y]);
    return 0;
}